import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import createHistory from 'history/createBrowserHistory'
import { routerMiddleware } from 'react-router-redux';
import rootReducer from '../reducers'
import { composeWithDevTools } from 'redux-devtools-extension';

const history = createHistory();
const middleware = routerMiddleware(history)
const middlewares = [thunk, middleware];

export default createStore(rootReducer, composeWithDevTools(applyMiddleware(...middlewares)));